﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules
{
    /// <summary>
    /// 项目考勤点表
    ///</summary>
    [TableName("project_position")]
    [Description("项目考勤点设置-经纬度、考勤范围")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true, PropertyNamesOfArea = "ProjectId")]
    [Serializable]
    public class ProjectPosition : IEntity
    {
        /// <summary>
        /// 主键
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 项目id
        ///</summary>
        [Column("name")]
        public string Name { get; set; }

        /// <summary>
        /// 项目id
        ///</summary>
        [Column("project_id")]
        public int ProjectId { get; set; }

        /// <summary>
        /// WGS84 纬度
        ///</summary>
        [Column("lat")]
        public decimal Lat { get; set; }

        /// <summary>
        /// WGS84 经度
        ///</summary>
        [Column("lng")]
        public decimal Lng { get; set; }

        /// <summary>
        /// 考勤范围（单位：米）
        ///</summary>
        [Column("attendance_scope")]
        public int AttendanceScope { get; set; }

        /// <summary>
        /// 详细地址
        ///</summary>
        [Column("address")]
        public string Address { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}